#ifndef _PARTHUS_UT_ATS_LOWER_TESTER_H
#define _PARTHUS_UT_ATS_LOWER_TESTER_H
/*************************************************************************
 * MODULE NAME:    ut_ats_lower_tester.h
 * PROJECT CODE:    BlueStream
 * DESCRIPTION:    Lower Tester Functions for the abstract test suite
 * MAINTAINER:     John Nelson
 * DATE:           1 Feb 2001
 *
 * SOURCE CONTROL: $Id: ut_ats_lower_tester.h,v 1.1 2008/02/03 09:39:25 james Exp $
 *
 * LICENSE:
 *     This source code is copyright (c) 2001-2004 Ceva Inc.
 *     All rights reserved.
 *
 * REVISION HISTORY:
 *    V1.0     01 Feb  2001 -   jn     - Initial Version
 *
 * SOURCE: Based on Abstract Test Suites TP V0.9
 * ISSUES:
 *
 *************************************************************************/
#include "sys_types.h"
#include "test_support.h"
#include "ut_ats_generic.h"

/*
 * Some default lower tester parameters 
 */
#define UTlt_DEFAULT_TIMING_JITTER   14
#define UTlt_DEFAULT_TIMING_DRIFT    123   

/*
 * Module Management: Initialise
 */
void UTlt_Initialise(void);

/*****************************************************************************
 *  Function:   UTlt_Create_Baseband_Connection    
 *              IUT Slave
 *
 *  Creates an ACL baseband connection to given bd_addr
 *  Supports multi-point connection setup.
 *
 *  Returns the connection handle if successful, aborts if not successful.
 *****************************************************************************/
u_int16 UTlt_Create_Baseband_Connection(const u_int8 bd_addr[6], u_int16 packet_types,
    u_int8 page_scan_repetition_mode, u_int8 page_scan_mode,
    u_int32 master_bt_clock_in_FHS, u_int8 allow_role_switch);

/*****************************************************************************
 *  Function:   UTlt_Create_Connection_Pre_Setup_Complete    
 *              IUT Slave
 *
 *  Creates an ACL connection to given bd_addr (normally IUT) stopping 
 *  before the setup complete messages are exchanged to allow further 
 *  connection setup LMP signalling.
 *  Supports multi-point connection setup.
 *
 *  Returns the connection handle if successful, aborts if not successful.
 *****************************************************************************/
u_int16 UTlt_Create_Connection_Pre_Setup_Complete(
    const u_int8 bd_addr[6], u_int16 packet_types,
    u_int8 page_scan_repetition_mode, u_int8 page_scan_mode,
    u_int32 master_bt_clock_in_FHS, u_int8 allow_role_switch);

/*****************************************************************************
 *  Function:   UTlt_Create_Connection    
 *              IUT Slave
 *
 *  Creates and completes ACL connection to given bd_addr
 *  Supports multi-point connection setup.
 *
 *  Returns the connection handle if successful, aborts if not successful.
 *****************************************************************************/
u_int16 UTlt_Create_Connection(const u_int8 bd_addr[6], u_int16 packet_types,
    u_int8 page_scan_repetition_mode, u_int8 page_scan_mode,
    u_int32 master_bt_clock_in_FHS, u_int8 allow_role_switch);

/**************************************************************************
 * UTlt_Disconnect_Connection
 *
 * Disconnect the ACL connection based on connection handle
 *
 * connection_handle        ACL connection handle to be disconnected
 *
 * Lower tester will send LMP detach and verify that connection
 * is successfully disconnected
 *************************************************************************/
t_error UTlt_Disconnect_Connection(u_int16 connection_handle);

/*
 * Accessors for tester information (available from the generic module)
 * Also available here for Lower Tester Consistency
 */
#define UTlt_Set_Bd_Addr(p_bd_addr)         UTgen_Set_Bd_Addr(p_bd_addr)
#define UTlt_Get_Bd_Addr_Ref()              UTgen_Get_Tester_Bd_Addr_Ref()
#define UTlt_Get_Bd_Addr_Byte_Array_Ref()   UTgen_Get_Tester_Bd_Addr_Byte_Array_Ref()

#define UTlt_Get_Tester_Features_Ref()      UTgen_Get_Tester_Features_Ref()
#define UTlt_Set_Tester_Features(features)  UTgen_Set_Tester_Features(features)
#define UTlt_Enable_Feature(feature_id)     UTgen_Enable_Feature(feature_id)
#define UTlt_Disable_Feature(feature_id)    UTgen_Disable_Feature(feature_id)
#define UTlt_Is_Tester_Feature_Supported(feature_id) UTgen_Is_Tester_Feature_Supported(feature_id)

#define UTlt_Get_Tester_Role()              UTgen_Get_Tester_Role()

/*
 * Default Class of Device for sending/verification
 */
#define UTlt_DEFAULT_CLASS_OF_DEVICE 0x001f00

u_int32 UTlt_Get_Class_Of_Device(void);     
void UTlt_Set_Class_Of_Device(u_int32 class_of_device);     

/*
 * Default Voice Settings  Linear coding 2's comp 16 bit input ->CVSD air-mode
 */
#define UTlt_DEFAULT_VOICE_SETTINGS_LINEAR_2s_16_CVSD 0x0060

u_int16 UTlt_Get_Voice_Settings(void);
void UTlt_Set_Voice_Settings(u_int16 voice_settings);     
u_int8 UTlt_Get_LM_SCO_Air_Mode(void);


/*
 * Support the forcing of transaction ids sent/verified for a sequence
 */
void UTlt_Force_Transaction_Id(u_int8 trans_id);
void UTlt_Use_Role_Transaction_Id(void);

/*
 * Generic Send/Verify for LMP Commands and L2CAP data
 */
/*
 * Check over the next max_frames for the given LC pdu (L2CAP/LMP).
 */
u_int32 UTlt_Wait_For_Message(t_packetTypes valid_packets, const u_int8 *message,
        u_int32 length, u_int8 device_role, u_int32 max_frames, t_arqn arqn);

void UTlt_Send_LMP_Command(const u_int8 *payload, u_int8 length);
u_int32 UTlt_Verify_LMP_Command(const u_int8 *lmp_payload, u_int8 length);
u_int32 UTlt_Verify_LMP_Opcode(u_int8 lmp_opcode);

void UTlt_Send_L2CAP_Start(t_packet packet_type, const u_int8 *payload, u_int16 length);
void UTlt_Send_L2CAP_Continue(t_packet packet_type, const u_int8 *payload, u_int16 length);
void UTlt_Send_L2CAP_Segmented(t_packet packet_type, const u_int8 *payload, 
    u_int16 length, u_int16 segment_size);
u_int32 UTlt_Verify_L2CAP_Data(const u_int8 *payload, u_int16 length);
void UTlt_Verify_L2CAP_Last_Flow(t_flow flow);

t_packet UTlt_Wait_For_Next_Non_SCO_Packet(void);

void UTlt_Send_POLL(t_arqn arqn);
void UTlt_Send_POLL_On_AM_Addr(t_am_addr am_addr, t_arqn arqn); /* eSCO */
void UTlt_Send_NULL(t_arqn arqn);
void UTlt_Send_NULL_On_AM_Addr(t_am_addr am_addr, t_arqn arqn); /* eSCO */
void UTlt_Verify_POLL(t_arqn arqn);
void UTlt_Verify_POLL_On_AM_Addr(t_am_addr am_addr, t_arqn arqn); /* eSCO */
void UTlt_Verify_NULL(t_arqn arqn);
void UTlt_Verify_NULL_On_AM_Addr(t_am_addr am_addr, t_arqn arqn); /* eSCO */

void UTlt_Send_Packet_With_Header(                               
    t_packet packet, t_am_addr am_addr, t_seqn seqn, t_arqn arqn, t_flow flow);

void UTlt_Send_ID(void);
void UTlt_Verify_ID(void);

void UTlt_Send_FHS(const t_bd_addr* bd_addr, 
    u_int8 am_addr, u_int32 clk, t_classDevice device_class);
void UTlt_Verify_FHS(const t_bd_addr* bd_addr, 
    u_int8 am_addr, t_clock clk, t_classDevice device_class);

void UTlt_Send_SCO_Packet(t_packet sco_packet, const u_int8* sco_data);
u_int32 UTlt_Verify_SCO_Packet(t_packet sco_packet, const u_int8* sco_data);

void UTlt_Send_eSCO_Packet(t_packet esco_packet, const u_int8* esco_data, u_int16 esco_length, 
                           t_crc crc, t_hec hec, u_int8 arqn);
void UTlt_Send_eSCO_Packet_by_Handle(u_int16 esco_handle,t_packet esco_packet, const u_int8* esco_data, u_int16 esco_length, 
                           t_crc crc, t_hec hec, u_int8 arqn);

void UTlt_Send_eSCO_Packet_Outside_Window(t_packet esco_packet, const u_int8* esco_data, u_int16 esco_length, 
                           t_crc crc, t_hec hec, u_int8 arqn);
void UTlt_Send_eSCO_Packet_For_SCO_Connection_Number(u_int8 sco_connection_number, t_packet esco_packet, const u_int8* esco_data, u_int16 esco_length, 
                           t_crc crc, t_hec hec, u_int8 arqn);

u_int32 UTlt_Verify_eSCO_Packet(const u_int8 *payload, u_int16 length, t_arqn arqn);
u_int32 UTlt_Verify_eSCO_Remote_Loopback(t_packet esco_packet, u_int8 t_esco, u_int8 w_esco,
    u_int16 pkt_len);
void UTlt_Verify_eSCO_Packet_in_Slot(t_packet esco_packet, const u_int8* esco_data, u_int16 esco_length);

void UTlt_Send_DV_SCO_ACL(const u_int8* sco_data, 
    t_LCHmessage message_type, const u_int8* acl_data, u_int8 acl_length);
u_int32 UTlt_Verify_DV_SCO_ACL(const u_int8* sco_data, 
    t_LCHmessage message_type, const u_int8* acl_data, u_int8 acl_length);


t_packet UTlt_Send_Broadcast(t_packet packet_type, t_seqn tx_seqn, 
        t_LCHmessage message_type, const u_int8 *payload, u_int8 length);

/*
 * Specific LMP Commands Definitions for Lower Tester Send
 * (Alphabetical Order)
 */
void UTlt_Send_LMP_invalid_command(u_int8* pdu, u_int8 length, u_int8 ti);

void UTlt_Send_LMP_absence_notify(u_int8 abs_index, u_int8 abs_flags,
    u_int32 abs_instant, u_int16 abs_win,
    u_int16 abs_ival, u_int32 reserved_mbz);
void UTlt_Send_LMP_accepted(u_int8 op_code);
void UTlt_Send_LMP_accepted_ext(u_int16 ext_opcode);
void UTlt_Send_LMP_active_address(const u_int8* bd_addr, u_int16 reserved, 
    u_int32 instant);
void UTlt_Send_LMP_alias_address(const u_int8* bd_addr, u_int16 reserved);
void UTlt_Send_LMP_au_rand(const u_int8* random_number);
void UTlt_Send_LMP_auto_rate(void);
void UTlt_Send_LMP_channel_classification_req(u_int8 afh_rep_mode,
    u_int16 afh_min_int, u_int16 afh_max_int);
void UTlt_Send_LMP_channel_classification(const u_int8* afh_chan_class);
void UTlt_Send_LMP_clkoffset_req(void);
void UTlt_Send_LMP_clkoffset_res(u_int16 clock_offset);
void UTlt_Send_LMP_comb_key(const u_int8* random_number);
void UTlt_Send_LMP_decr_power_req(u_int8 arg1);
void UTlt_Send_LMP_detach(u_int8 reason);
void UTlt_Send_LMP_encryption_key_size_req(u_int8 key_size);
void UTlt_Send_LMP_encryption_key_size_mask_req(void);
void UTlt_Send_LMP_encryption_key_size_mask_res(u_int16 key_size_mask);
void UTlt_Send_LMP_encryption_mode_req(u_int8 enc_mode);
void UTlt_Send_LMP_esco_link_req(u_int8 handle, u_int8 am_addr,
    u_int8 timing_ctrl_flags, u_int8 d_esco,
    u_int8 t_esco, u_int8 w_esco, 
    u_int8 m2s_pkt_type, u_int8 s2m_pkt_type,
    u_int16 m2s_pkt_len, u_int16 s2m_pkt_len,
    u_int8 air_mode, u_int8 negotiate_flag);
void UTlt_Send_LMP_features_req(const u_int8 *features_list);
void UTlt_Send_LMP_features_req_ext(u_int8 feat_page, u_int8 max_feat_page,
    const u_int8* ext_features);
void UTlt_Send_LMP_features_res(const u_int8 *features_list);
void UTlt_Send_LMP_features_res_ext(u_int8 feat_page, u_int8 max_feat_page,
    const u_int8* ext_features);
void UTlt_Send_LMP_fixed_address(const u_int8* bd_addr_fixed, u_int16 rsvd);
void UTlt_Send_LMP_hold(u_int16 hold_time,u_int32 hold_instant);
void UTlt_Send_LMP_hold_req(u_int16 hold_time,u_int32 hold_instant);
void UTlt_Send_LMP_host_connection_req(void);
void UTlt_Send_LMP_incr_power_req(u_int8 arg1);
void UTlt_Send_LMP_in_rand(const u_int8* random_number);
void UTlt_Send_LMP_max_absences(u_int16 max_absence_index);
void UTlt_Send_LMP_max_power(void);
void UTlt_Send_LMP_max_slot(u_int8 max_slots);
void UTlt_Send_LMP_max_slot_req(u_int8 max_slots);
void UTlt_Send_LMP_min_power(void);
void UTlt_Send_LMP_modify_beacon(u_int8 timing_control_flags, u_int16 d_b, 
    u_int16 t_b, u_int8 n_b, u_int8 delta_b, u_int8 d_access, 
    u_int8 t_access, u_int8 n_accslots, u_int8 n_poll, 
    u_int8 m_access, u_int8 access_scheme);
void UTlt_Send_LMP_name_req(u_int8 name_offset);
void UTlt_Send_LMP_name_res(u_int8 name_offset, u_int8 length, const u_int8 *fragment);
void UTlt_Send_LMP_not_accepted(u_int8 op_code, u_int8 reason);
void UTlt_Send_LMP_not_accepted_ext(u_int16 op_code, u_int8 reason);
void UTlt_Send_LMP_page_mode_req(u_int8 paging_scheme, u_int8 settings);
void UTlt_Send_LMP_page_scan_mode_req(u_int8 paging_scheme, u_int8 settings);
void UTlt_Send_LMP_park_req(u_int8 timing_control_flags, u_int16 d_b, u_int16 t_b, 
    u_int8 n_b, u_int8 delta_b, u_int8  pm_addr, 
    u_int8 ar_addr, u_int8 n_bsleep, u_int8 d_bsleep, u_int8 d_access, 
    u_int8 t_access, u_int8 n_accslots, u_int8 n_poll, u_int8 m_access, 
    u_int8 access_scheme);
void UTlt_Send_LMP_pp_extension_req(u_int8 n_presence_attempt);
void UTlt_Send_LMP_preferred_rate(u_int8 data_rate);
void UTlt_Send_LMP_quality_of_service(u_int16 poll_interval, u_int8 Nbc);
void UTlt_Send_LMP_quality_of_service_req(u_int16 poll_interval, u_int8 Nbc);
void UTlt_Send_LMP_remove_esco_link_req(u_int8 esco_handle, u_int8 reason);
void UTlt_Send_LMP_remove_sco_link_req(u_int8 sco_handle, u_int8 reason);
void UTlt_Send_LMP_scatter_algorithms_req(void);
void UTlt_Send_LMP_scatter_algorithms_res(const u_int8* supported_algorithms_mask);
void UTlt_Send_LMP_scatter_req(u_int8 n_ce_timeout, u_int8 n_presence_attempt,
    u_int16 t_scatter_poll, u_int8 t_pp_anchor,
    u_int8 d_pp_anchor, u_int8 sched_algorithm,
    u_int8 mod_pp_flag, u_int8 timing_flags);
void UTlt_Send_LMP_set_subrate(u_int8 n_subrate_level);
void UTlt_Send_LMP_sco_link_req(u_int8 sco_handle, u_int8 timing_control_flags,
    u_int8 d_sco, u_int8 t_sco, u_int8 sco_packet, u_int8 air_mode);
void UTlt_Send_LMP_set_afh(u_int32 instant, u_int8 mode, const u_int8* channel_map);
void UTlt_Send_LMP_set_broadcast_scan_window(u_int8 timing_control_flags,
    u_int16 d_b, u_int16 broadcast_scan_window);
void UTlt_Send_LMP_setup_complete(void);
void UTlt_Send_LMP_slot_offset(u_int16 slot_offset, const u_int8 *bd_addr);
void UTlt_Send_LMP_sniff_req(u_int16 d_sniff, u_int16 t_sniff, u_int16 sniff_attempt,
    u_int16 sniff_timeout, u_int8 timing_control_flags);
void UTlt_Send_LMP_sres(const u_int8* auth_response);
void UTlt_Send_correct_LMP_sres_on_handle(const u_int16 handle);
void UTlt_Send_LMP_start_encryption_req(const u_int8* rand_num);
void UTlt_Send_LMP_stop_encryption_req(void);
void UTlt_Send_LMP_supervision_timeout(u_int16 supervision_timeout);
void UTlt_Send_LMP_switch_req(u_int32 switch_instant);
void UTlt_Send_LMP_temp_key(const u_int8* random_number);
void UTlt_Send_LMP_temp_rand(const u_int8* random_number);
void UTlt_Send_LMP_test_activate(void);
void UTlt_Send_LMP_test_control(u_int8 test_scenario, u_int8 hopping_mode,
    u_int8 tx_frequency, u_int8 rx_frequency, u_int8 power_control_mode,
    u_int8 poll_period, u_int8 packet_type, u_int16 packet_length);
void UTlt_Send_LMP_timing_accuracy_req(void);
void UTlt_Send_LMP_timing_accuracy_res(u_int8 drift, u_int8 jitter);
void UTlt_Send_LMP_unit_key(const u_int8* random_number);
void UTlt_Send_LMP_unpark_bd_addr_req(u_int8 timing_control_flags,
    u_int16 d_b, u_int8 num_addrs, const u_int8* am_addr_list, 
    const u_int8* bd_addr_list);
void UTlt_Send_LMP_unpark_pm_addr_req(u_int8 timing_control_flags, u_int16 d_b, 
    u_int8 num_addrs, const u_int8* am_addr_list, 
    const u_int8* pm_addr_list);
void UTlt_Send_LMP_unscatter_req(u_int8 reason);
void UTlt_Send_LMP_unsniff_req(void);
void UTlt_Send_LMP_use_semi_permanent_key(void);
void UTlt_Send_LMP_version_req(u_int8 vers_nr, u_int16 comp_id, u_int16 subvers_nr);
void UTlt_Send_LMP_version_res(u_int8 vers_nr, u_int16 comp_id, u_int16 subvers_nr);

/*
 * Generic Power Check Routines
 */
boolean UTlt_Check_If_LMP_min_power(void);
boolean UTlt_Check_If_LMP_max_power(void);
boolean UTlt_Check_If_LMP_preferred_rate(u_int8 rate);
boolean UTlt_Check_If_LMP_incr_power_req(void);
boolean UTlt_Check_If_LMP_decr_power_req(void);
boolean UTlt_Check_If_LMP_set_AFH(void);

/*
 * Specific LMP Commands Definitions for Lower Tester Receive
 * (Alphabetical Order)
 */
u_int32 UTlt_Verify_LMP_absence_notify(u_int8 index, u_int8 flags, u_int32 instant,
    u_int16 window, u_int16 ival, u_int32 rsvd_mbz);
u_int32 UTlt_Verify_LMP_accepted(u_int8 op_code);
u_int32 UTlt_Verify_LMP_accepted_ext(u_int16 ext_op_code);
u_int32 UTlt_Verify_LMP_active_address(const u_int8* bd_addr, u_int16 rsvd, u_int32 instant);
u_int32 UTlt_Verify_LMP_alias_address(const u_int8* bd_addr_alias, u_int16 rsvd);
u_int32 UTlt_Verify_LMP_au_rand(const u_int8* random_number);
u_int32 UTlt_Verify_LMP_auto_rate(void);
u_int32 UTlt_Verify_LMP_channel_classification_req(u_int8 afh_reporting_mode, 
    u_int16 afh_max_ival, u_int16 afh_min_ival);
u_int32 UTlt_Verify_LMP_channel_classification(const u_int8* afh_channel_classification);
u_int32 UTlt_Verify_LMP_clkoffset_req(void);
u_int32 UTlt_Verify_LMP_clkoffset_res(u_int16 clk_offset);
u_int32 UTlt_Verify_LMP_clkoffset_res_header_only(u_int16 clk_offset);
u_int32 UTlt_Verify_LMP_comb_key(const u_int8* random_number);
u_int32 UTlt_Verify_LMP_decr_power_req(u_int8 for_future_use);
u_int32 UTlt_Verify_LMP_detach(u_int8 reason);
u_int32 UTlt_Verify_LMP_encryption_key_size_req(u_int8 key_size);
u_int32 UTlt_Verify_LMP_encryption_key_size_mask_req(void);
u_int32 UTlt_Verify_LMP_encryption_key_size_mask_res(u_int16 key_size_mask);
u_int32 UTlt_Verify_LMP_encryption_mode_req(u_int8 enc_mode);
u_int32 UTlt_Verify_LMP_esco_link_req(u_int8 handle, u_int8 am_addr, u_int8 tc_flags,
    u_int8 d_esco, u_int8 t_esco, u_int8 w_esco,
    u_int8 m2s_pkt_type, u_int8 s2m_pkt_type,
    u_int16 m2s_pkt_len, u_int16 s2m_pkt_len,
    u_int8 air_mode, u_int8 neg_flag);
u_int32 UTlt_Verify_LMP_features_req(const u_int8 *features_list);
u_int32 UTlt_Verify_LMP_features_req_ext(u_int8 page, u_int8 max_page,
    const u_int8 *ext_features_list);
u_int32 UTlt_Verify_LMP_features_res(const u_int8 *features_list);
u_int32 UTlt_Verify_LMP_features_res_ext(u_int8 page, u_int8 max_page,
    const u_int8 *ext_features_list);
u_int32 UTlt_Verify_LMP_fixed_address(const u_int8* bd_addr_fixed, u_int16 rsvd);
u_int32 UTlt_Verify_LMP_hold(u_int16 hold_time,u_int32 hold_instant);
u_int32 UTlt_Verify_LMP_hold_req(u_int16 hold_time,u_int32 hold_instant);
u_int32 UTlt_Verify_LMP_host_connection_req(void);
u_int32 UTlt_Verify_LMP_incr_power_req(u_int8 for_future_use);
u_int32 UTlt_Verify_LMP_in_rand(const u_int8* random_number);
u_int32 UTlt_Verify_LMP_max_absences(u_int16 max_absence_index);
u_int32 UTlt_Verify_LMP_max_power(void);
u_int32 UTlt_Verify_LMP_max_slot(u_int8 max_slots);
u_int32 UTlt_Verify_LMP_max_slot_req(u_int8 max_slots);
u_int32 UTlt_Verify_LMP_min_power(void);
u_int32 UTlt_Verify_LMP_modify_beacon(u_int8 timing_control_flags, u_int16 d_b, 
    u_int16 t_b, u_int8 n_b, u_int8 delta_b, u_int8 d_access, u_int8 t_access, 
    u_int8 n_accslots, u_int8 n_poll, u_int8 m_access, u_int8 access_scheme);
u_int32 UTlt_Verify_LMP_name_req(u_int8 name_offset);
u_int32 UTlt_Verify_LMP_name_res(u_int8 name_offset, u_int8 length, const u_int8 *fragment);
u_int32 UTlt_Verify_LMP_not_accepted(u_int8 op_code, u_int8 reason);
u_int32 UTlt_Verify_LMP_not_accepted_ext(u_int16 op_code, u_int8 reason);
u_int32 UTlt_Verify_LMP_page_mode_req(u_int8 paging_scheme, u_int8 paging_scheme_settings);
u_int32 UTlt_Verify_LMP_page_scan_mode_req(u_int8 paging_scheme, u_int8 paging_scheme_settings);
u_int32 UTlt_Verify_LMP_park_req(u_int8 timing_control_flags, u_int16 d_b, 
    u_int16 t_b, u_int8 n_b, u_int8 delta_b, u_int8  pm_addr, 
    u_int8 ar_addr, u_int8 n_bsleep, u_int8 d_bsleep, u_int8 d_access, 
    u_int8 t_access, u_int8 n_accslots, u_int8 n_poll, u_int8 m_access, 
    u_int8 access_scheme);
u_int32 UTlt_Verify_LMP_pp_extension_req(u_int8 n_presence_attempt);
u_int32 UTlt_Verify_LMP_preferred_rate(u_int8 data_rate);
u_int32 UTlt_Verify_LMP_quality_of_service(u_int16 poll_interval, u_int8 Nbc);
u_int32 UTlt_Verify_LMP_quality_of_service_req(u_int16 poll_interval, u_int8 Nbc);
u_int32 UTlt_Verify_LMP_remove_esco_link_req(u_int8 handle, u_int8 reason);
u_int32 UTlt_Verify_LMP_remove_sco_link_req(u_int8 handle, u_int8 reason);
u_int32 UTlt_Verify_LMP_scatter_algorithms_req(void);
u_int32 UTlt_Verify_LMP_scatter_algorithms_res(const u_int8* supported_algorithms_mask);
u_int32 UTlt_Verify_LMP_scatter_req(u_int8 n_ce_timeout, u_int8 n_presence_attempt,
    u_int16 t_scatter_poll, u_int8 t_pp_anchor,
    u_int8 d_pp_anchor, u_int8 scheduling_algorithm,
    u_int8 mod_pp_flag, u_int8 timing_flags);
u_int32 UTlt_Verify_LMP_set_subrate(u_int8 n_subrate_level);
u_int32 UTlt_Verify_LMP_sco_link_req(u_int8 handle, u_int8 timing_ctrl, u_int8 d_sco, 
    u_int8 t_sco, u_int8 pkt_type, u_int8 air_mode);
u_int32 UTlt_Verify_LMP_set_afh(u_int32 instant, u_int8 mode, const u_int8* channel_map);
u_int32 UTlt_Verify_LMP_set_afh_return_instant_ticks(
    u_int32 *p_instant_ticks, u_int8 mode, const u_int8* channel_map);
u_int32 UTlt_Verify_LMP_set_broadcast_scan_window(u_int8 timing_control_flags, u_int16 d_b, 
    u_int16 broadcast_scan_window);
u_int32 UTlt_Verify_LMP_setup_complete(void);
u_int32 UTlt_Verify_LMP_slot_offset(u_int16 slot_offset, const u_int8* bd_addr);
u_int32 UTlt_Verify_LMP_sniff_req(u_int16 d_sniff, u_int16 t_sniff, u_int16 sniff_attempt,
    u_int16 sniff_timeout, u_int8 timing_control_flags);
u_int32 UTlt_Verify_LMP_sres(const u_int8* random_number);
u_int32 UTlt_Verify_LMP_start_encryption_req(u_int8* rand_num);
u_int32 UTlt_Verify_LMP_stop_encryption_req(void);
u_int32 UTlt_Verify_LMP_supervision_timeout(u_int16 supervision_timeout);
u_int32 UTlt_Verify_LMP_switch_req(u_int32 switch_instant);
u_int32 UTlt_Verify_LMP_temp_key(const u_int8* random_number);
u_int32 UTlt_Verify_LMP_temp_rand(const u_int8* random_number);
u_int32 UTlt_Verify_LMP_test_activate(void);
u_int32 UTlt_Verify_LMP_test_control(u_int8 test_scenario, u_int8 hopping_mode,
    u_int8 tx_frequency, u_int8 rx_frequency, u_int8 power_control_mode,
    u_int8 poll_period, u_int8 packet_type, u_int16 packet_length);
u_int32 UTlt_Verify_LMP_timing_accuracy_req(void);
u_int32 UTlt_Verify_LMP_timing_accuracy_res(u_int8 drift, u_int8 jitter);
u_int32 UTlt_Verify_LMP_unit_key(const u_int8* random_number);
u_int32 UTlt_Verify_LMP_unpark_bd_addr_req(u_int8 timing_control_flags,
    u_int16 d_b, u_int8 num_slaves, const u_int8* am_addr_list,
    const u_int8* bd_addr_list);
u_int32 UTlt_Verify_LMP_unpark_bd_addr_req_one_slave(u_int8 timing_control_flags,
    u_int16 d_b,u_int8 am_addr,const t_bd_addr* bd_addr);
u_int32 UTlt_Verify_LMP_unpark_pm_addr_req(u_int8 tc_flags, u_int16 d_b, u_int8 num_slaves,
    const u_int8* am_addr_list, const u_int8* pm_addr_list);
u_int32 UTlt_Verify_LMP_unpark_pm_addr_req_one_slave(u_int8 timing_control_flags,
    u_int16 d_b,u_int8 am_addr,u_int8 pm_addr);
u_int32 UTlt_Verify_LMP_unsniff_req(void);
u_int32 UTlt_Verify_LMP_unscatter_req(u_int8 reason);
u_int32 UTlt_Verify_LMP_use_semi_permanent_key(void);
u_int32 UTlt_Verify_LMP_version_req(u_int8 vers_nr, u_int16 comp_id, u_int16 subvers_nr);
u_int32 UTlt_Verify_LMP_version_res(u_int8 vers_nr, u_int16 comp_id, u_int16 subvers_nr);

u_int16 UTlt_Verify_L2CAP_Message_Type(t_packetTypes valid_packets, u_int8 length, t_LCHmessage lch, u_int8 device_role, u_int32 max_frames);

void UTlt_Enable_Hardware_SCO_Conversion_Emulation(void);
void UTlt_Disable_Hardware_SCO_Conversion_Emulation(void);
void UTlt_Emulate_SCO_Conversion(u_int8* rx_esco_pcm_payload, u_int16 rx_pkt_len);

#endif

